1. Field of the Invention
The present invention relates to security count values in a wireless communications system. In particular, the present invention discloses a method for obtaining a security count value for a new channel that is established during a changing of a security key.
2. Description of the Prior Art
Please refer to FIG. 1. FIG. 1 is a simplified block diagram of a prior art wireless communications system. The wireless communications system includes a first station 10 in wireless communications with a second station 20. As an example, the first station 10 is a mobile unit, such as a cellular telephone, and the second station 20 is a base station. The first station 10 communicates with the second station 20 over a plurality of channels 12. The second station 20 thus has corresponding channels 22, one for each of the channels 12. Each channel 12 has a receiving buffer 12r for holding protocol data units (PDUs) 11r received from the corresponding channel 22 of the second station 20. Each channel 12 also has a transmitting buffer 12t for holding PDUs 11t that are awaiting transmission to the corresponding channel 22 of the second station 20. A PDU 11t is transmitted by the first station 10 along a channel 12 and received by the second station 20 to generate a corresponding PDU 21r in the receiving buffer 22r of the corresponding channel 22. Similarly, a PDU 21t is transmitted by the second station 20 along a channel 22 and received by the first station 10 to generate a corresponding PDU 11r in the receiving buffer 12r of the corresponding channel 12.
For the sake of consistency, the data structures of each PDU 11r, 11t, 21r and 21t along corresponding channels 12 and 22 are identical. That is, a transmitted PDU 11t generates an identical corresponding received PDU 21r, and vice versa. Furthermore, both the first station 10 and the second station 20 use identical PDU 11t, 21t data structures. Although the data structure of each PDU 11r, 11t, 21r and 21t along corresponding channels 12 and 22 is identical, different channels 12 and 22 may use different PDU data structures according to the type of connection agreed upon along the corresponding channels 12 and 22. In general, though, every PDU 11r, 11t, 21r and 21t will have a sequence number 5r, 5t, 6r, 6t. The sequence number 5r, 5t, 6r, 6t is an m-bit number that is incremented for each PDU 11r, 11t, 21r, 21t. The magnitude of the sequence number 5r, 5t, 6r, 6t indicates the sequential ordering of the PDU 11r, 11t, 21r, 21t in its buffer 12r, 12t, 22r, 22t. For example, a received PDU 11rwith a sequence number 5r of 108 is sequentially before a received PDU 11r with a sequence number 5r of 109, and sequentially after a PDU 11r with a sequence number 5r of 107. The sequence number 5t, 6t is often explicitly carried by the PDU 11t, 21t, but may also be implicitly assigned by the station 10, 20. For example, in an acknowledged mode setup for corresponding channels 12 and 22, each transmitted PDU 11t, successful reception of which generates an identical corresponding PDU 21r, is confirmed as received by the second station 20. A 12-bit sequence number 5t is explicitly carried by each PDU 11t in acknowledged mode transmissions. The second station 20 scans the sequence numbers 6r embedded within the received PDUs 21r to determine the sequential ordering of the PDUs 21r, and to determine if any PDUs 21r are missing. The second station 20 can then send a message to the first station 10 that indicates which PDUs 21r were received by using the sequence numbers 6r of each received PDU 21r, or may request that a PDU It be re-transmitted by specifying the sequence number 5t of the PDU 11t to be re-transmitted. Alternatively, in a so-called transparent transmission mode, data is never confirmed as successfully received. The sequence numbers 5t, 6t are not explicitly carried in the PDUs 11t, 21t. Instead, the first station 10 simply internally assigns a 7-bit sequence number 5t to each PDU 11t. Upon reception, the second station 20 similarly assigns a 7-bit sequence number 6r to each PDU 21r. Ideally, the sequence numbers 5t maintained by the first station 10 for the PDUs 11t are identical to the corresponding sequence numbers 6r for the PDUs 21r that are maintained by the second station 20.
Hyper-frame numbers (HFNs) are also maintained by the first station 10 and the second station 20. Hyper-frame numbers may be thought of as high-order (i.e., most significant) bits of the sequence numbers 5t, 6t, and which are never physically transmitted with the PDUs 11t, 21t. Exceptions to this rule occur in rare cases of special signaling PDUs 11t, 21t that are used for synchronization. In these cases, the HFNs are not carried as part of the sequence number 11t, 21t, but instead are carried in fields of the data payload of the signaling PDU 11t, 21t, and thus are more properly signaling data. As each transmitted PDU 11t, 21t generates a corresponding received PDU 21r, 11r, hyper-frame numbers are also maintained for received PDUs 11r, 21r. In this manner, each received PDU 11r, 21r, and each transmitted PDU 11t, 21t is assigned a value that uses the sequence number (implicitly or explicitly assigned) 5r, 6r, and 5t, 6t as the least significant bits, and a corresponding hyper-frame number (always implicitly assigned) as the most significant bits. Each channel 12 of the first station 10 thus has a receiving hyper-frame number (HFNR) 13r and a transmitting hyper-frame number (HFNT) 13t. Similarly, the corresponding channel 22 on the second station 20 has a HFNR 23r and a HFNT 23t. When the first station 10 detects rollover of the sequence numbers 5r of PDUs 11r in the receiving buffer 12r, the first station 10 increments the HFNR 13r. On rollover of sequence numbers 5t of transmitted PDUs 11t, the first station 10 increments the HFNT 13t. A similar process occurs on the second station 20 for the HFNR 23r and HFNT 23t. The HFNR 13r of the first station 10 should thus be synchronized with (i.e., identical to) the HFNT 23t of the second station 20. Similarly, the HFNT 13t of the first station 10 should be synchronized with (i.e., identical to) the HFNR 23r of the second station 20.
The PDUs 11t and 21t are not transmitted “out in the open”. A security engine 14 on the first station 10, and a corresponding security engine 24 on the second station 20, together ensure secure and private exchanges of data exclusively between the first station 10 and the second station 20. The security engine 14, 24 has two primary functions. The first is the obfuscation (i.e., ciphering, or encryption) of data held within a PDU 11t, 21t so that the corresponding PDU 11r, 21r presents a meaningless collection of random numbers to an eavesdropper. The second function is to verify the integrity of data contained within the PDUs 11r, 21r. This is used to prevent another, improper, station from masquerading as either the first station 10 or the second station 20. By verifying data integrity, the first station 10 can be certain that a PDU 11r was, in fact, transmitted by the second station 20, and vice versa. For transmitting a PDU 11t, the security engine 14 uses, amongst other inputs, an n-bit security count 14c and a security key 14k to perform the ciphering functions upon the PDU 11t. To properly decipher the corresponding PDU 21r, the security engine 24 must use an identical security count 24c and security key 24k. Similarly, data integrity checking on the first station 10 uses an n-bit security count that must be synchronized with a corresponding security count on the second station 20. As the data integrity security count is generated in a manner similar to that for the ciphering security count 14c, 24c, and as ciphering is more frequently applied, the ciphering security count 14c, 24c is considered in the following. The security keys 14k and 24k remain constant across all PDUs 11tand 21t (and thus corresponding PDUs 21r and 11r), until explicitly changed by both the first station 10 and the second station 20. Changing of the security keys 14k, 24k is effected by a security mode command that involves handshaking between the first station 10 and the second station 20 to ensure proper synchronization of the security engines 14, 24. The security mode command is relatively infrequently performed, and depends upon the value of the security count 14c. They security keys 14k, 24k are thus relatively persistent. The security counts 14c and 24c, however, continuously change with each PDU 11t and 21t. This constant changing of the security count 14c, 24c makes decrypting (and spoofing) of PDUs 11t, 21t more difficult, as it reduces statistical consistency of inputs into the security engine 14, 24. The security count 14c for a PDU 11t is generated by using the sequence number 5t of the PDU 11t as the least significant bits of the security count 14c, and the HFNT 13t associated with the sequence number 5t as the most significant bits of the security count 14c. Similarly, the security count 14c for a PDU 11r is generated from the sequence number 5r of the PDU 11r and the HFNR 13r of the PDU 11r. An identical process occurs on the second station 20, in which the security count 24c is generated using the sequence number 6r or 6t, and the appropriate HFNR 23r or HFNT 23t. The security count 14c, 24c has a fixed bit size, say 32 bits. As the sequence numbers 5r, 6r, 5t, 6t may vary in bit size depending upon the transmission mode used, the hyper-frame numbers HFNR 13r, HFNR 23r, HFNT 13t and HFNT 23t must vary in bit size in a corresponding manner to yield the fixed bit size of the security count 14c, 24c. For example, in a transparent transmission mode, the sequence numbers 5r, 6r, 5t, 6t are all 7 bits in size. The hyper-frame numbers HFNR 13r, HFNR 23r, HFNT 13t and HFNT 23t are thus 25 bits in size; combining the two together yields a 32 bit security count 14c, 24c. On the other hand, in an acknowledged transmission mode, the sequence numbers 5r, 6r, 5t, 6t are all 12 bits in size. The hyper-frame numbers HFNR 13r, HFNR 23r, HFNT 13t and HFNT 23t are thus 20 bits in size so that combining the two together continues to yield a 32 bit security count 14c, 24c. 
Initially, there are no established channels 12 and 22 between the first station 10 and the second station 20. The first station 10 thus establishes a channel 12 with the second station 20. To do this, the first station 10 must determine an initial value for the HFNT 13t and HFNR 13r. The first station 10 references a non-volatile memory 16, such as a flash memory device or a SIM card, for a start value 16s, and uses the start value 16s to generate the initial value for the HFNT 13t and the HFNR 13r. The start value 16s holds the x most significant bits (MSBx) of a hyper-frame number from a previous session along a channel 12. Ideally, x should be at least as large as the bit size of the smallest-sized hyper-frame number (i.e., for the above example, x should be at least 20 bits in size). The MSBx of the HFNT 13t and the HFNR 13r are set to the start value 16s, and the remaining low order bits are set to zero. The first station 10 then transmits the start value 16s to the second station 20 (by way of a special signaling PDU 11t) for use as the HFNR 23r and the HFNT 23t. In this manner, the HFNT 13t is synchronized with the HFNR 23r, and the HFNT 23t is synchronized with the HFNR 13r. 
As noted, the first station 10 may establish a plurality of channels 12 with the second station 20. Each of these channels 12 uses its own sequence numbers 5r and 5t, and hyper-frame numbers 13r and 13t. When establishing a new channel 12, the first station 10 considers the HFNT 13t and HFNR 13r of all currently established channels 12, selecting the HFNT 13tor HFNR 13r having the highest value. The first station 10 then extracts the MSBx of this highest-valued hyper-frame number 13r, 13t, increments the MSBx by one, and uses it as the MSBx for the new HFNT 13t and HFNR 13r for a newly established channel 12. Synchronization is then performed between the first station 10 and the second station 20 to provide the MSBx to the second station 20 for the HFNR 23r and HFNT 23t. In this manner, a constantly incrementing spacing is ensured between the security counts 14c of all established channels 12.
It is noted that, for the sake of security, the security keys 14k and 24k should be changed after a predetermined interval. This interval is, in part, determined by the security count 14c, 24c. When the security count 14c for an established channel 12 exceeds a predetermined security cross-over value 14x, the second station 20 (i.e., the base station) may initiate the security mode command to change the security keys 14k and 24k to new security keys 14n and 24n. Both of the security keys 14n and 24n are identical, and should not be the same as the previous security keys 14k and 24k. Changing over to the new security keys 14n, 24n must be carefully synchronized across all channels 12, 22 to ensure that that transmitted PDUs 11t, 21tare properly deciphered into received PDUs 21r, 11r. For example, if a PDU 11t is enciphered using the security key 14k and the security engine 24 attempts to decipher the corresponding received PDU 21r using the new security key 24n, the received PDU 21r will be deciphered into meaningless data due to the lack of synchronization of the security keys 14k and 24n as applied to the PDUs 11t and 21r. The security mode command is a somewhat complicated process that takes a finite amount of time. Clearly, before the transmitting of the security mode command by the second station 20, only the security key 14k, 24k is used for all channels 12, 22. Similarly, after the security mode command has been fully completed, only the new security key 14n, 24n will be used for all channels 12, 22. However, during execution of the security mode command, and the resulting hand-shaking between the two stations 10 and 20, there could be confusion as to which security key 14k, 24k, or 14n, 24n should be used. To prevent this from happening, the security mode command provides for a so-called activation time 17r, 27t for each channel 12, 22. The activation time 17r, 27t is simply a sequence number value 5r, 6t of PDUs 11r, 21t. When executing the security mode command, the second station 20 determines an activation time 27t for the transmitting buffer 22t of each channel 22. The activation times 27t are not necessarily the same across all channels 22, and, in fact, will generally be different. The security mode command sent by the second station 20 to the first station 10 provides the activation times 27t to the first station 10, which the first station 10 then uses to generate an identical corresponding activation time 17r for the receiving buffer 12r of each channel 12. In response to the security mode command, the first station 10 determines an activation time 17t for the transmitting buffer 12t of each channel 12. The first station 10 then sends a security mode complete message to the second station 20, which contains the activation times 17t. The second station 20 uses the security mode complete message to provide an activation time 27r to the receiving buffer 22r of each channel 22, which is identical to the activation time 17t of the corresponding channel 12 on the first station 10. The security mode command, and resultant final activation time 17t, are termed a security mode reconfiguration. Using the first station 10 as an example, for all PDUs 11t that have sequence numbers 5t that are prior to the activation time 17t for their channel 12, the PDUs 11t are enciphered using the old security key 14k. For PDUs 11t which have sequence numbers 5t that are sequentially at or after the activation time 17t, the new security key 14n is applied for enciphering. When receiving the PDUs 11t, the second station 20 uses the sequence numbers 6r and the activation time 27r to determine which key 24k or 24n to use for deciphering of the PDUs 21r. A similar transmitting process also occurs on the second station 20, with each channel 22 having the activation time 27t. The security mode command provides for synchronization of the activation times 17r with 27t and 17t with 27r so that the second station 20 and first station 10 may know how to apply their respective security keys 24n, 24k and 14n, 14k to received PDUs 21r, 11r and transmitted PDUs 11t, 21t. In this manner, synchronization is ensured between the security engines 14 and 24. To ensure that full use is obtained from the new security key 14n, 24n, upon adoption of the new security key 14n, 24n by a channel 12, 22 (i.e., after the activation times 17r, 17t and 27r, 27t for the channels 12 and 22), the HFNR 13r, 23r and the HFNT 13t, 23t are cleared to zero, thus bringing the security count 14c, 24c for the channel 12, 22 down to zero, or close to zero. For example, after a channel 12 exceeds its activation time 17t, the HFNT 13t for the channel 12 is set to zero. The corresponding security count 14c for the transmitted PDUs 11t is thus brought close to zero. Similarly, upon receiving a PDU 21r that exceeds the activation time 27r, the second station 20 clears the HFNR 23r, thus reducing the security count 24c for the received PDUs 21r. 
However, the establishment of a new channel 12 during the security mode reconfiguration may lead to a problem that shortens the lifetime of the new security key 14n. When a new channel 12 is being established during the security mode reconfiguration, it is possible that there will be established channels 12 that are using the new security key 14n, and other channels 12 that are still using the old security key 14k. Those channels 12 using the new security key 14n will have hyper-frame numbers 13r, 13t that are zero, or close to zero. However, those channels 12 still using the old security key 14k (because they have not yet reached their respective activation times 13a) will have hyper-frame numbers 13r, 13t that are quite high. When assigning the hyper-frame numbers 13r, 13t to the new channel 12, the first station 10 scans all established channels 12, selects the highest hyper-frame number 13r, 13t, increments this value by one and then assigns it to the hyper-frame numbers 13r and 13t for the new channel 12. The new channel 12 will thus receive hyper-frame numbers 13r, 13t that are much greater than zero, and which may possibly lead to the formation of a security count 14c for the new channel 12 that is very close to the security cross-over value 14x. This will cause a considerable shortening of the lifetime of the new security key 14n. 